Generally speaking, there have been many patents issued on rail-to-rail input hysteresis comparators. However, although the circuits disclosed in these patents can meet the requirements for the application as a hysteresis comparator in the respective input voltage ranges, all of these circuits cannot perform satisfactorily in terms of common mode rejection ratio (CMRR) when the common mode input voltages are in certain ranges.
A typical rail-to-rail input hysteresis comparator includes a P-type comparator and an N-type comparator, and according to the superposition principle, the performance of the rail-to-rail input hysteresis comparator depends upon both the performance of the P-type comparator and the performance of the N-type comparator. In general cases, most operational amplifiers and comparators used in integrated circuits (ICs), including the aforementioned P-type and N-type comparators, have a differential architecture, and use of differential amplifiers is intended to take advantage of the characteristic of such devices that, for two input signals, they only amplify their respective differential components but do not amplify their common mode components. This characteristic of differential amplifiers can be measured by CMRR which is defined as the absolute value of a ratio of the amplifiers' differential gain to their common mode gain:
  CMRR  =                        A        DM                    A        CM                
As can be seen from its above definition, CMRR is prone to significant variation.
Although there have been proposed a variety of solutions that can overcome this drawback, they all fail to impart satisfactory CMRR properties to conventional rail-to-rail input hysteresis comparators.
FIGS. 1a and 1b show the simulation results of a conventional rail-to-rail input hysteresis comparator. As shown in these figures, with the common mode input voltage Vcm varying linearly from 0 to VDDA, there are two ranges, namely the range II (in which the P-type comparator operates properly, while a current source of the N-type comparator operates in a linear mode) and the range IV (in which a current source of the P-type comparator operates in a linear mode, while the N-type comparator operates properly) shown in FIG. 1a, which leads to a high common mode gain but a poor CMRR, rendering the CMRR of the rail-to-rail input hysteresis comparator unstable.